using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Web.Configuration;

namespace Impact.Web.Admin
{
    public partial class ResetPassword : System.Web.UI.Page
    {
        /// <summary>
        /// event handler for when the user clicks the GO button.
        /// </summary>
        protected void GoCommand(object sender, CommandEventArgs e)
        {

            if (Request.UserHostAddress.Equals("127.0.0.1") || Request.UserHostAddress.Equals("::1"))
            {
                MembershipUser user = Membership.GetUser(this.target.Text);
                if (user != null)
                {
                    this.output.Text = string.Format("Your new password is: {0}", user.ResetPassword());
                }
                else
                {
                    this.output.Text = "Username not found.";
                }
            }

            else
            {
                this.output.Text = "This function is available on the server.";
            }


        }
    }
}
